angular.module('music_information', [])
    .controller('music_informationCtrl', function ($scope, httpUtil) {
        $scope.discoverList = [];
        $scope.newList = [];
        $scope.topList = [];
        $scope.connectedList = [];

        //初始化歌曲
        $scope.musicInit = init;
        init('', 12);//初始化发现列表
        setTimeout(function () {
            init('1', 8);//初始化新歌列表
            setTimeout(function () {
                init('2', 5);//初始化热歌列表
                setTimeout(function () {
                    init('21', 20);//初始化链接列表
                },500);
            },500);
        },500);
        function init (type, maxSums){
            var params = {
                type: type,
                firstIndex: 0,
                maxSums: maxSums
            };
            httpUtil.httpSend('Music_musicList.action', params, function(data){
                if(type == ''){
                    $scope.discoverList = data.data;
                } else if(type == 1){
                    $scope.newList = data.data;
                } else if(type == 2){
                    $scope.topList = data.data;
                } else if(type == 21){
                    $scope.connectedList = data.data;
                }
            });
        }
    });